package com.foreverwin.mes.production.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.foreverwin.mes.meapi.model.Resrce;
import com.foreverwin.mes.production.model.StationResource;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author syngna
 * @since 2018-12-03
 */
@Repository
public interface StationResourceMapper extends BaseMapper<StationResource> {

    /**
     * 查询岗位下维护的设备
     * @param stationBo
     * @return
     */
    List<Resrce> selectResourceListByStation(@Param("stationBo") String stationBo);

    /**
     * 根据设备查询岗位
     * @param resrce
     * @return
     */
    List<StationResource> selectStationListByResource(@Param("site") String site, @Param("resrce") String resrce);

    /**
     * 删除岗位下资源
     * @param stationBo
     * @return
     */
    int deleteResourceByStation(@Param("stationBo") String stationBo);

    /**
     * 岗位添加设备
     * @param list
     * @return
     */
    int insertStationResource(List<StationResource> list);

}